<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.pojo.OUser,com.pojo.Sstatis"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Map,java.util.Date,java.text.SimpleDateFormat"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd 

">
<%
	OUser user = (OUser) session.getAttribute("user");
	String list = (String) request.getAttribute("list");

	List list1 = (List) request.getAttribute("list1");
%>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>太原金属交易中心</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="Assets/css/reset.css" />
<script type="text/javascript" src="Assets/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="Assets/js/js_z.js"></script>
<link rel="stylesheet" type="text/css" href="Assets/css/thems.css">
<script src="<%=basePath%>datajs/survey.js"></script>
</head>
<script type="text/javascript">
	$(document).ready(function() {
		fun();
		platmx();
	});
</script>
<script type="text/javascript">
 /* var arr=[]
for(var i=0;i<d.length;i++){
	var item=d[i];
	var html=item.date 
	arr.push(html)
		
} */
//var mths = ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"];
var mths = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];


	function fun() {
		//查看成交明细
		var list =<%=list%>;
		console.log(list);
		var html = "";
		var a = 0;
		for ( var i in list) {
			a++;
		}
		$('#ssss1').html(a);
		$('#ssss2').html(a);
		var mast = 5;
		if (list.length < 5) {
			mast = list.length;
		}
		for (var i = 0; i < mast; i++) {
			html += '<tr><td>' + list[i].obv + '</td><td>' + list[i].wprice
					+ '</td></tr>';
		}
		$('#table').html(html);
	}
	function datetoString(date){
		var d = new Date(date.getTime()); 	
		var dd = d.getDate() < 10 ? "0" + d.getDate() : d.getDate().toString(); 	
		var mmm = mths[d.getMonth()];
	//    var mm =d.getMonth();
		var yyyy = d.getFullYear().toString(); 
	 	return yyyy+"-"+mmm+"-"+dd;
	}
	function platmx(){
		var d=new Date()
	//	var x=datetoString(d);
		var day=new Array(7)
		day[0]="星期日"
		day[1]="星期一"
		day[2]="星期二"
		day[3]="星期三"
		day[4]="星期四"
		day[5]="星期五"
		day[6]="星期六"
		var s=day[d.getDay()]
		var s1;
	
		/* for (var i in arr) {
			if (arr[i].indexOf(x) > -1) {
				alert("true")
			}
		} */
		/* if(s=="星期六"||s=="星期日"){
			s1="今天是"+s+",暂无商品交易信息!"
			$('#xianshi').html(s1);
			$(".step3").hide();
		}
		else{ */
			s1="今天是"+s+",商品交易信息如下：!"
			$('#xianshi').html(s1);
			$.ajax({
			type : 'post',
			url : 'selectplatmx.html' ,
			scriptCharset : 'utf-8',
			success : function(data) {
				var s1 = JSON.parse(data);				
				console.log(data)
				var html1 = "";
			 	for ( var i in s1) {		 				
					html1 += '<tr><td>'
				        + s1[i].goods + '</td><td>'
					        + s1[i].openprice + '</td><td  style="text-align:center;">'
							+ s1[i].sellcount + '</td><td  style="text-align:center;">'
							+ s1[i].obv + '</td><td>'
							+ 0.003 + '</td></tr>';
					
				}	 		
				$('#platmx').html(html1);
			}
		});	 
		 
		//}
		
	}
</script>
<body>

	<!--头部-->
	<div class="h_top">
		<div class="h_top_m">
			欢迎来到商品交易大厅网 <span> 您好！<%=user.getUserID()%>
			</span>
		</div>
	</div>
	<!--顶部-->
	<!--头部-->
	<div class="header clearfix">
		<div class="logo">
			<a href="<%=basePath%>index.html"><img src="Assets/images/logo.png" alt="" /></a>
		</div>
		<div class="tel">
			<!--img src="Assets/images/tel.png" alt="400-168-0000"-->
		</div>
	</div>
	<div class="nav_bg">
		<ul class="nav clearfix">
			<li><a href="main.html">首页</a></li>
			<li class="now"><a href="bypt.html">商品交易</a></li>
			<li><a href="member.html">我的账户</a></li>
		</ul>
	</div>
	<!--头部-->

	<div class="banner banner_a">
		<img src="Assets/upload/banner_a.jpg" alt="白银平台" />
	</div>
	<!--幻灯片-->
	<div class="space_hx">&nbsp;</div>
	<!--当前位置-->
	<div class="position">
		<span>您当前的位置：</span> <a href="main.html">首页</a> <a href="bypt.html">平台交易</a>
	</div>
	<!--当前位置-->
	<div class="space_hx">&nbsp;</div>

	<div class="second">
		<div class="by_d">
			<dl class="by_da clearfix">
				<dt>
					<img src="<%=basePath%>Assets/upload/pic3.jpg" alt="" />
					<div class="name">
						<span>交易大厅</span> <em>&nbsp;</em>
					</div>
					<div class="btn">
						<a href="selectwtdprice.html" class="bg_r">我要买入</a> <a
							href="selectwtdprice.html" class="bg_y">我要卖出</a>
					</div>
				</dt>
				<dd>
				<div>
				<span id="xianshi" style="font-size:16px;font-weight:600"></span>
				</div>		
				<div class="step3">
					<table border="0" cellpadding="0" cellspacing="0" >
						<thead>
							<tr>
								<th style="width:100px;">商品名称</th>
								<th style="width:80px;">指导价</th>
								<th style="width:100px;">累计成交（笔）</th>
								<th style="width:100px;">累计出售（颗）</th>
								<th style="width:100px;">手续费</th>
							</tr>
						</thead>
						<tbody id="platmx" >

						</tbody>						
					</table>
					</div>				
					<p></p>
				</dd>
					<table>
					<tr>
					<%
					String goodspic="";
					for(int i=0;i<list1.size();i++){
						Map mp = (Map)list1.get(i);
						String pic = "Assets/images/aa.jpg";
						goodspic=(String)mp.get("classname");
						 if(mp.get("classname").equals("帕帕拉宝石")){
							pic = "Assets/images/20180207110630.jpg";
						}  
						
					%>
					
					<td> <a href="<%=basePath%>selectwtdprice.html?goods=<%=mp.get("classname") %>"><img id="img1" src="<%=pic %>" height="150" width="140"></td>
					<%
						
					}
					%>
					</tr>
					</table>
			</dl>
			<div class="space_hx">&nbsp;</div>
			<div class="by_db">
				<div class="tabBox_t">
					<div class="tabBox">
						<ul class="tabNav">
							<li class="now"><span>大厅当前出售记录</span></li>
						</ul>
						<div class="tabCont" style="display: block;">
							<table width="100%" class="Transaction1">
								<thead>
									<tr>
										<th scope="col">成交数量</th>
										<th scope="col">成交金额</th>
									</tr>
								</thead>
								<tbody id="table">

								</tbody>
							</table>
						</div>

					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="space_hx">&nbsp;</div>
	<div class="space_hx">&nbsp;</div>
	<div class="f_nav_bg">
		<dl class="f_nav clearfix">
			<dt>
				<img src="Assets/images/tel.png" />
			</dt>
			<dd>


				<div class="tip" style="float: left; width: 200px;">
					<span style="font-size: 16px;">商品团队</span>
					<li>太原金属企业站</li>
					<li>太原金属商城</li>
					<li>太原金属会员网</li>
				</div>

				<div class="tip" style="float: left; width: 200px;">
					<span style="font-size: 16px;">服务帮助</span>

					<li><a href="news.html?classid=4">为什么选择我们</a></li>

					<li><a href="news.html?classid=3">网站声明</a></li>

					<li><a href="news.html?classid=2">公司公告</a></li>

					<li><a href="news.html?classid=1">行业动态</a></li>

				</div>

				<div class="tip">
					<p>交易大厅</p>
					<p>&nbsp;</p>
				</div>



			</dd>
		</dl>
		<div class="copyriht">版权解释权归太原金属所有</div>
	</div>
</body>
</html>
